<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <h:head>
        <title>Agent - Estate Details</title>
        <link href="style.css" rel="stylesheet" type="text/css"></link>
        <div style="text-align: center;"><h:graphicImage url="/Images/back.png"></h:graphicImage></div>

    </h:head>
    <h:body>
        <h:form prependId="false">
            <div id="wrapper">
                <div id="logo">

                </div>
                <div id="header">
                    <!-- 		<div id="menu">
                    
                            </div>    -->
                </div>
                <div class="page">
                    <div id="page-bgtop">

                        <div id="dummy"></div>
                         <p:panel id="panelsidebar" header="Pages Menu">
                            <ui:include src="MenuAgent.xhtml"/>
                        </p:panel>

                        <!-- end #sidebar -->

                        <div id="content">
                            <p:panel header="Estate Details" id="panel">   
                                 <p:galleria effect="#{agentbean.effect}" effectSpeed="1000">
                                    <ui:repeat value="#{agentbean.images}" var="image">
                                        <p:graphicImage value="//Images/#{image}"
                                                        title="#{image}" alt="Description goes here"/>
                                    </ui:repeat>
                                </p:galleria>
                               
                                 <h:panelGrid columns="2" id="grid">

                                     <h:outputText value="City: "/>
                                     <h:outputText value="#{agentbean.selectedEstate.province}" />
                                   
                                    <h:outputText value="District: "/>
                                    <h:outputText value="#{agentbean.selectedEstate.district}" />
                                    <h:outputText value="Type: "/>
                                    <h:outputText value="#{agentbean.selectedEstate.type}" />
                                    
                                    
                                    
                                    <h:outputText value="Price: "/>
                                    <h:outputText value="#{agentbean.selectedEstate.price}"/>
                                   
                                    <h:outputText value="Description: "/>
                                    <h:outputText value="#{agentbean.selectedEstate.description}" style="width:300px;height:100px;" />
                                    <h:outputText value="On Construction: "/>
                                    <h:outputText value="#{agentbean.selectedEstate.isConstruction ? 'Yes' : 'No'}"/>
                                    <h:outputText value="Country Side: "/>
                                    <h:outputText value="#{agentbean.selectedEstate.isCountryside ? 'Yes' : 'No'}"/>
                                    <h:outputText value="Construction Percept: "/>
                                    <h:outputText value="#{agentbean.selectedEstate.perceptOfConstruction}" />
                                    <h:outputText value="Customer ID: "/>
                                    <p:inputMask mask="99999999999" value="#{agentbean.selectedEstate.customerId}" required="true" requiredMessage="Cannot be empty!" />
                                   
                                 </h:panelGrid>
                                <h:messages style="color: red" />
                                <h:panelGrid columns="2">
                                    <p:commandButton update="panel" value="Sell" rendered="#{agentbean.selectedEstate.type eq 'Sale'}" action="#{agentbean.sellOrRentEstate}"></p:commandButton>		
                                    <p:commandButton update="panel" value="Rent" rendered="#{agentbean.selectedEstate.type eq 'Rent'}" action="#{agentbean.sellOrRentEstate}"></p:commandButton>		
                                </h:panelGrid> 
                             
                            </p:panel>

                        </div>
                        <!-- end #content -->

                        <div style="clear: both;">&nbsp;</div>
                    </div>

                    <!-- end #page -->

                </div>
                <div id="footer-bgcontent">
                    <div id="footer" align="center">
                        <p>İstanbul Teknik Üniversitesi - Software Engineering Course - Real Estate Management</p>
                    </div>
                </div>
                <!-- end #footer -->
            </div>

        </h:form>
    </h:body>
</html>